﻿function confirmeSignOut() {
    $.confirm({
        'title': 'Sign out',
        'message': 'Do you want to sign out ?',
        'buttons': {
            'Yes': {
                'class': 'blue',
                'action': function () {
                	window.location.href="../UserLogin?command=signOutL";
                }

            },
            'No': {
                'class': 'gray',
                'action': function () {
                    return false;
                }

            }
        }
    });
}

function onSelectFile(e) {
	// Array with information about the uploaded files
    var files = e.files;

    // Check the extension of each file and abort the upload if it is not .jpg
    $.each(files, function() {
    	var ext = this.extension;
        if (ext != ".jpg" && ext != ".png") {
            alert("Only .jpg files can be uploaded");
            e.preventDefault();
        }
    });
};

function addProductToCart(id) {
	$("#thanhCart").load("cartModule.jsp?idProduct="+id);
};

function showEditCart(id) {
	$("#thanhCart").load("ajaxTest.jsp?idProduct="+id);
};xoaKhoiGioHang

function xoaKhoiGioHang(id) {
	$("#thanhCart").load("cartModule.jsp?idProduct="+id+"&command=del");
};
